package cn.edu.scau.cmi.mingjunhui.composite.safe;

public class SafePerson extends SafeComponent{
	public SafePerson(SafeComponent org, String _name)
	{
		super(org, _name);
	}
	
	@Override
	public String toString(int pos)
	{
		String parentName = getParent() == null ? "无" : getParent().getName();
		String blank = "";
		for(int i=0; i<pos; ++i) blank += " ";
		return  blank + "\"" + getName() + "\": {\n"
		+ blank + "	\"类型\": \"个人\",\n"
		+ blank + "	\"父亲\": \"" + parentName + "\"\n"
		+ blank + "}\n";
	}
	
	@Override
	public String toString()
	{
		return toString(0);
	}
}
